<template>
  <div class="common">
    <div class="info-body" v-if="info.length > 0">
      <van-cell-group>
        <van-cell
          v-for="(item, index) in info"
          :key="index + 1"
          :title="item.startTime + '~' + item.endTime"
          :label="item.task"
        />
      </van-cell-group>
    </div>
    <van-empty v-else description="今日还未添加计划,快去添加吧!" />
  </div>
</template>

<script setup>
import { watch } from 'vue'

const props = defineProps({
  title: {
    type: String,
    default: '',
  },
  info: {
    type: Array,
    default: [],
  },
})

watch(
  () => props.info,
  (newValue, oldValue) => {
    console.log(oldValue, '->', newValue)
  }
)
</script>

<style lang="scss" scoped>
.common {
  height: 50vh;

  .info-body {
    padding: 20px;
  }
}
</style>